home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / moden / examples / explog0.pas < prev    next >
Pascal/Delphi Source File  |  1996-04-08  |  1KB  |  54 lines

  1. unit Explog0;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, AdProtcl, AdPStat, AdTerm, AdPort;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ApdComPort1: TApdComPort;
  12.     ApdTerminal1: TApdTerminal;
  13.     ListBox1: TListBox;
  14.     TransmitAll: TButton;
  15.     ApdProtocol1: TApdProtocol;
  16.     ApdProtocolStatus1: TApdProtocolStatus;
  17.     Label1: TLabel;
  18.     procedure ApdProtocol1ProtocolLog(CP: TObject; Log: Word);
  19.     procedure TransmitAllClick(Sender: TObject);
  20.     procedure ApdProtocol1ProtocolFinish(CP: TObject; ErrorCode: Integer);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure TForm1.ApdProtocol1ProtocolLog(CP: TObject; Log: Word);
  35. begin
  36.   if Log = lfTransmitOK then
  37.     ListBox1.Items.Add(ApdProtocol1.FileName);
  38. end;
  39.  
  40. procedure TForm1.TransmitAllClick(Sender: TObject);
  41. begin
  42.   ApdTerminal1.Active := False;
  43.   ApdProtocol1.StartTransmit;
  44. end;
  45.  
  46. procedure TForm1.ApdProtocol1ProtocolFinish(CP: TObject;
  47.   ErrorCode: Integer);
  48. begin
  49.   ApdTerminal1.Active := True;
  50.   ApdTerminal1.SetFocus;
  51. end;
  52.  
  53. end.
  54.